discrete math inverse function